package com.whb.event;

/**
 * @Author labu
 * @Date 2020/11/26
 * @Description
 */
public class Main {
    public static void main(String[] args) {
        MyEventSource source = new MyEventSource();
        source.addListener(event -> {
            event.doEvent();
            if (event.getSource().equals("111")){
                System.out.println(111);
            }
        });

        source.notifyListeners(new MyEventObject("111"));
        source.notifyListeners(new MyEventObject("222"));
    }
}
